package 笔试.美团;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Demo05 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //n个节点
        int n = sc.nextInt();
        //m次交换
        int m = sc.nextInt();
        //根节点值
        int k = sc.nextInt();
        int[][] nums = new int[n][2];
        TreeNode root = new TreeNode(k);
        for (int i = 0; i < n; i++) {
            nums[i][0] = sc.nextInt();
            nums[i][1] = sc.nextInt();
        }
        while (sc.hasNext()){
            List<Integer> list = new ArrayList<>();
            list.add(sc.nextInt());
        }
        //m次变换
        for (int i = 0; i < m; i++) {

        }



        inorder(root);
    }

    public static void inorder(TreeNode node){
        if(node==null) return;
        inorder(node.left);
        System.out.print(node.val+" ");
        inorder(node.right);
    }

}
class TreeNode{
    int val;
    TreeNode left;
    TreeNode right;

    public TreeNode(int val) {
        this.val = val;
    }
}
